{$R-}
(*
	flash -- a sample HyperCard external command.
	ŠApple Computer, Inc. 1987
	All Rights Reserved.

	To compile and link this file using Macintosh Programmer's Workshop
	(HyperXCmd.p and XCmdGlue.inc must be accessible):

	pascal Flash.p
	link -o HyperCommands -rt XCMD=0 -sn Main=Flash Flash.p.o

    then use ResEdit to copy the resulting XCMD from HyperCommands
	and paste it into the Home stack, or your own stack.
	
	When you build your own XCMDs, if you need to load 
	"{MPW}"Libraries:interface.o, then say -m ENTRYPOINT in the link statement
	to filter out all routines you don't use.
*)

{$S Flash } 	{ Segment name must be the same as the command name. }

UNIT DummyUnit;

INTERFACE

USES MemTypes, QuickDraw, HyperXCmd;

PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
	
IMPLEMENTATION

TYPE Str31 = String[31];

PROCEDURE Flash(paramPtr: XCmdPtr); 							FORWARD;

  PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
  BEGIN
    Flash(paramPtr);
  END;

  PROCEDURE Flash(paramPtr: XCmdPtr);
  VAR flashCount: LongInt;	
      i: INTEGER;
	  port: GrafPtr;
	  str: Str255;

    {$I XCmdGlue.inc }

  BEGIN
	ZeroToPas(paramPtr^.params[1]^,str);	{ first param is flash count }
	flashCount := StrToNum(str);
	GetPort(port);
	FOR i := 1 TO flashCount DO 
	  BEGIN
		InvertRect(port^.portRect);
		InvertRect(port^.portRect);
	  END;
  END;


END.



